<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<p>倒计时<span id="times"></span>秒后,自动跳转到主页面</p>
<script type="text/javascript">
    var i = 5
    c = document.getElementById("times")
    setInterval(function () {
        c.innerHTML = i--;
        if (i == 0) {
            location = "${pageContext.request.contextPath}/zuoye2.html"
        }
    }, 1000)
</script>
</body>
</html>